package com.sgcc.pda.hw;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by 闫亚锋 on 2018/2/1
 * desc：
 */

public class ReturnResult implements Parcelable {
    /**
     * 成功失败的标志  0：成功  其他失败
     */
    private int code;

    /**
     * 返回的数据 具体参考对应方法的返回值
     */
    private List<String> datas;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public List<String> getDatas() {
        return datas;
    }

    public void setDatas(List<String> datas) {
        this.datas = datas;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.code);
        dest.writeStringList(this.datas);
    }

    public ReturnResult() {
    }

    protected ReturnResult(Parcel in) {
        this.code = in.readInt();
        this.datas = in.createStringArrayList();
    }

    public void readFromParcel(Parcel in) {
        this.code = in.readInt();
        this.datas = in.createStringArrayList();
    }

    public static final Creator<ReturnResult> CREATOR = new Creator<ReturnResult>() {
        @Override
        public ReturnResult createFromParcel(Parcel source) {
            return new ReturnResult(source);
        }

        @Override
        public ReturnResult[] newArray(int size) {
            return new ReturnResult[size];
        }
    };
}
